<template>
  <div>
    <div class="input-wrap">
      <div class="input-area">
        <el-input placeholder="请输入故障信息" v-model="searchStr"></el-input>
        <img src="../assets/voice.png" style="width: 28px; height: 28px;">
      </div>
      <div class="jump-wrap" @click="jump">
        <img src="../assets/jump-arrow.png">
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['defaultStr'],
  data () {
    return {
      searchStr: '',
    }
  },
  mounted() {
    if(this.defaultStr) {
      this.searchStr = this.defaultStr
    }
  },
  methods: {
    jump() {
      this.$emit('search', this.searchStr)
    }
  }
}
</script>

<style scoped lang='less'>
.input-wrap {
  display: flex;
  margin-top: 40px;
}
.input-area {
  width: 674px;
  height: 40px;
  padding: 10px 10px 10px 30px;
  background: #F6F6F6;
  border-radius: 30px 0 0 30px;
  box-shadow: 0 4px 4px #afafaf;
  display: flex;
  align-items: center;
}
/deep/ .el-input__inner {
  background-color: #f6f6f6 !important;
  border: none !important;
  font-size: 16px;
}
.jump-wrap {
  width: 66px;
  height: 60px;
  background-color: #4394EE;
  box-shadow: 0 4px 4px #afafaf;
  border-radius: 0 30px 30px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

</style>
